﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace RelightERP.BLL
{
    public class DataAccessHelper
    {
        #region Variable and Object declaration
        string connString = DefaultHelper.GetConnString();
        DataAccess dataAccess;
        #endregion

        public DataAccessHelper()
        {
            dataAccess = null; //new DataAccess(connString);
        }

        #region ExecuteNonQuery
        public int ExecuteNonQuery(bool isStoredProc, string sqlID, List<SqlParameter> paramList)
        {
            int rowAffected = 0;
            using (dataAccess = new DataAccess(connString))
            {
                rowAffected = dataAccess.ExecuteNonQuery(isStoredProc, DefaultHelper.GetSql(sqlID), paramList);
            }
            return rowAffected;
        }
        #endregion
        
    }
}
